package com.fh.mappers;

import com.fh.entity.po.Key;
import com.fh.entity.po.Value;
import com.fh.entity.vo.KeyVo;
import com.fh.entity.vo.Result;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 描述:
 * Author:袁亚强
 * Date:2021/11/2216:11
 */
@Mapper
public interface KeyMapper {
    @Select("select * from t_shop_key where id=#{id}")
    Key queryByIdData(Integer id);

    void updateKey(Key key);

    @Insert("insert into t_shop_key (tid,isSku,name,nameID,optionType,createDate,isdel) value  (#{tid},#{isSku},#{name},#{nameID},#{optionType},#{createDate},#{isdel})")
    void addKey(Key key);

    Integer queryCount(Result result);

    List<Key> queryKeyList(Result result);

    @Select("select * from t_shop_key where name=#{name} and tid=#{tid}")
    Key queryByName(String name,Integer tid);

    @Select("select * from t_shop_key where isdel=0 and tid=#{id}")
    List<KeyVo> queryAllData(Integer id);
}
